import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import {export_infofn} from '@/request/api'
import store from "./store";
import ElementUI from "element-ui";
import md5 from "js-md5";
import "@/utils/rem.js";
import "@/utils/permission.js";
import "element-ui/lib/theme-chalk/index.css";
Vue.prototype.$md5 = md5;
Vue.use(ElementUI);
Vue.config.productionTip = false;
new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount("#app");




const myMixin = {
  props: {
  },
  data() {
    return {
    }
  },
  methods:{

    updataExpertInfn() {
      export_infofn()
        .then((res) => {
          res.result.all =
            res.result.middleReceived +
            res.result.wellReceived +
            res.result.negativeReceived;
          res.result.scoreAvg = Number(res.result.scoreAvg.toFixed(2));
          res.result.wellrate = Number(
            ((res.result.wellReceived / res.result.all) * 100).toFixed(2)
          );
          res.result.middlrate = Number(
            ((res.result.middleReceived / res.result.all) * 100).toFixed(2)
          );
          res.result.negarate = Number(
            ((res.result.negativeReceived / res.result.all) * 100).toFixed(2)
          );
          this.$store.commit("SETEXPERTINFO", res.result);
        })
        .catch((err) => {
          console.log(err, "获取专家信息失败");
        });
    },
  }
}

Vue.mixin(myMixin)